<!DOCTYPE html>
<html>
<head>
    <title>初审列表</title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/base.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <link href="css/layer.css" rel="stylesheet">
    <link href="css/pagination.css" rel="stylesheet">
    <link href="css/bootstrap-datetimepicker.css" rel="stylesheet">
    <link href="css/jedate.css" rel="stylesheet">
    <style>
        #loanDetail{
            background-color: #fff;
            margin-bottom: 15px;
        }
        #loanDetail p{
            padding-left:0 ;
            padding-right: 0;
            margin: 6px 0 ;
        }
        #loanDetail .wd_60{
            display: inline-block;
            width: 102px;
            text-align: right;
            font-size: 12px;
            font-family: "微软雅黑";
        }
        #loanDetail .c13 .wd_60{
            float: left;
            margin-top: 5px;
        }
        #loanDetail .c13 input{
            float: left;
            font-size: 12px;
            font-family: "微软雅黑";
        }
        #loanDetail .col-lg-3 ,#loanDetail .c13{
            margin:5px 0;
            padding-left:5px;
            padding-right: 5px;
        }

        #loanDetail select option{
            font-size: 12px;
            font-family: "微软雅黑";
        }
        .search_btn {
            font-size: 12px;
            background-color: #09C;
            padding: 5px 16px;
            margin-top: 3px;
            margin-bottom: 5px;
        }
        .ta_r{
            text-align: center;
        }
        .mr_25{
            margin-right: 25px;
        }
        #lateFee{
            border: 1px solid #ccc;
            height: 25px;
            line-height: 25px;
            text-indent: 5px;
            width: 120px;
            font-size: 13px;
        }
        .mt_3{
            margin: 3px 0;
        }
        .phoneStyle:hover{
            cursor: pointer;
            color: #09C;
        }
        .phoneStyle{
            cursor: pointer;
        }
    </style>
</head>
<body>
<div class="content1" href="">


    <!-- <div class="hui"><img src="/hd/static/images/ajax-loader.gif"></div> -->
    <div class="content">
        <!--面包屑导航start-->
        <ol class="breadcrumb">
            <li class="active">扣款列表查询</li>
        </ol>
        <div id="loanDetail" class="col-lg-12 col-md-12 col-sm-12">

            <div class="col-lg-3 col-md-3 col-sm-3"><span class="wd_60">合同号&nbsp;&nbsp;</span><input type="text" id="loanContNo"></div>
            <div class="col-lg-3 col-md-3 col-sm-3"><span class="wd_60">客户名称&nbsp;&nbsp;</span><input type="text" id="custName"></div>

            <div class="col-lg-3 col-md-3 col-sm-3 c13"><span class="wd_60">身份证号</span><input type="text" id="idNo"></div>
            <div class="col-lg-3 col-md-3 col-sm-3 c13"><span class="wd_60">还款账号</span><input type="text" id="acctNo"></div>
            <div class="col-lg-3 col-md-3 col-sm-3"><span class="wd_60">生成日期&nbsp;&nbsp;</span><input type="text" id="applyDateStart2" value="2019-05-22" placeholder="请选择时间" readonly=""></div>
            <div class="col-lg-3 col-md-3 col-sm-3"><span class="wd_60">批扣状态&nbsp;&nbsp;</span><select id="paySts">
               <!-- <option value="">-&#45;&#45;请选择-&#45;&#45;</option>
                <option value="00">生成清单</option>
                <option value="01">待再次发送</option>
                <option value="02">扣款中</option>
                <option value="03">代扣成功</option>
                <option value="04">代扣失败</option>
                <option value="05">JD签约中</option>
                <option value="06">JD签约失败</option>
                <option value="07">JD签约成功</option>

                <option value="601">微信预生成订单成功</option>
                <option value="602">微信预生成订单失败</option>
                <option value="603">微信支付失败</option>-->
            </select></div>
            <div class="col-lg-3 col-md-3 col-sm-3"><span class="wd_60">批扣渠道&nbsp;&nbsp;</span><select id="deductChannel">
                <option value="">---请选择---</option>
                <option value="10">通联支付</option>
                <option value="11">翼支付</option>
            </select></div>
            <div class="col-lg-3 col-md-3 col-sm-3"><span class="wd_60">是否可批扣&nbsp;&nbsp;</span><select id="deductStatus">
                <!--<option value="">-&#45;&#45;请选择-&#45;&#45;</option>
                <option value="0">可批扣</option>
                <option value="1">不可批扣</option>-->
            </select>
            </div>
            <div class="col-lg-12 col-md-6 col-sm-6 ta_r">
                <button class="btn btn-primary btn-sm search_btn" type="button" id="btn-search">查询</button>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <button class="btn btn-primary btn-sm search_btn" type="button" id="btn-export2" onclick="exportBatchDeduct();">导出</button>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <button class="btn btn-primary btn-sm search_btn " type="button" id="btn-export" onclick="sendDedution();">发送代扣</button>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <button class="btn btn-primary btn-sm search_btn" type="button" id="btn-deduct-query" onclick="batchDeductQuery();">批量代扣结果查询</button>
            </div>
            <div class="clear"></div>
        </div>
        <div class="table-responsive">
            <div id="lendingList_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer"><div class="top"><div class="clear"></div></div><div id="lendingList_processing" class="dataTables_processing panel panel-default" style="display: none;">处理中...</div><table id="lendingList" style="width: 100%;" class="table table-bordered table-striped table-hover bg_wt dataTable no-footer" role="grid" aria-describedby="lendingList_info">
                <thead style="border-bottom: 0;background-color: #fff;">
                <tr role="row"><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 13px;"><input class="allCkb" type="checkbox"></th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 58px;">生成日期</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 134px;">贷款合同号</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 40px;">客户姓名</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 127px;">证件号</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 46px;">应扣款</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 68px;">还款账户开户行</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 134px;">还款账号</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 99px;">发出代扣时间</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 35px;">扣款状态</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 73px;">扣款结果</th><th class="text-center fs_13 sorting_disabled" rowspan="1" colspan="1" style="width: 129px;">操作</th></tr>
                </thead>
                <tbody>
                </tbody>
            </table>
            </div>
            <div class="bottom">
                <div class="dataTables_info" id="bizList_info" role="status" aria-live="polite">

                </div>
                <div class="common_page"></div>

                <div class="clear"></div>
            </div>
                <!--<tbody><tr role="row" class="odd"><td><input type="checkbox" value="6536635612870476801" name="ids" class="ckb"></td><td>2019-05-22</td><td>6460777522599560193</td><td>秦文进</td><td>140931199412020039</td><td>1680</td><td>农业银行</td><td>6228481668120214070</td><td>2019-05-22 00:19:25.0</td><td>还款成功</td><td>微信支付还款成功</td><td><button type="button" data-id="6460777522599560193" class="btn btn-primary btn-sm mt_3" name="deduct-query">查询批扣结果</button></td></tr><tr role="row" class="even"><td><input type="checkbox" value="6536722134349120513" name="ids" class="ckb"></td><td>2019-05-22</td><td>6218698888606385153</td><td>袁小华</td><td>511121197704227204</td><td>2658.29</td><td>农业银行</td><td>6228480469623614374</td><td></td><td>生成清单</td><td></td><td><button type="button" data-id="6218698888606385153" class="btn btn-primary btn-sm mt_3" name="deduct-query">查询批扣结果</button><button type="button" data-id="6536722134349120513" data-loan-no="6218698888606385153" class="btn btn-primary btn-sm mt_3" name="public-deduct">对公还款</button></td></tr><tr role="row" class="odd"><td><input type="checkbox" value="6536722134508504065" name="ids" class="ckb"></td><td>2019-05-22</td><td>6220870104499880961</td><td>张大壮</td><td>320381199411087332</td><td>9605</td><td>农业银行</td><td>6228480405855885373</td><td></td><td>生成清单</td><td></td><td><button type="button" data-id="6220870104499880961" class="btn btn-primary btn-sm mt_3" name="deduct-query">查询批扣结果</button><button type="button" data-id="6536722134508504065" data-loan-no="6220870104499880961" class="btn btn-primary btn-sm mt_3" name="public-deduct">对公还款</button></td></tr><tr role="row" class="even"><td><input type="checkbox" value="6536722134579807233" name="ids" class="ckb"></td><td>2019-05-22</td><td>6222447517564404737</td><td>彭勇军</td><td>511323198502190878</td><td>1508.78</td><td>农业银行</td><td>6228480462785007214</td><td></td><td>生成清单</td><td></td><td><button type="button" data-id="6222447517564404737" class="btn btn-primary btn-sm mt_3" name="deduct-query">查询批扣结果</button><button type="button" data-id="6536722134579807233" data-loan-no="6222447517564404737" class="btn btn-primary btn-sm mt_3" name="public-deduct">对公还款</button></td></tr><tr role="row" class="odd"><td><input type="checkbox" value="6536722135246701569" name="ids" class="ckb"></td><td>2019-05-22</td><td>6235099307722146817</td><td>段兰亭</td><td>510121199511016089</td><td>2280.86</td><td>农业银行</td><td>6230520460001265978</td><td></td><td>生成清单</td><td></td><td><button type="button" data-id="6235099307722146817" class="btn btn-primary btn-sm mt_3" name="deduct-query">查询批扣结果</button><button type="button" data-id="6536722135246701569" data-loan-no="6235099307722146817" class="btn btn-primary btn-sm mt_3" name="public-deduct">对公还款</button></td></tr><tr role="row" class="even"><td><input type="checkbox" value="6536722135473193985" name="ids" class="ckb"></td><td>2019-05-22</td><td>6241093333441053697</td><td>陆洒洒</td><td>340321199112280826</td><td>12631.5</td><td>农业银行</td><td>6228480405226722974</td><td></td><td>生成清单</td><td></td><td><button type="button" data-id="6241093333441053697" class="btn btn-primary btn-sm mt_3" name="deduct-query">查询批扣结果</button><button type="button" data-id="6536722135473193985" data-loan-no="6241093333441053697" class="btn btn-primary btn-sm mt_3" name="public-deduct">对公还款</button></td></tr><tr role="row" class="odd"><td><input type="checkbox" value="6536722135930373121" name="ids" class="ckb"></td><td>2019-05-22</td><td>6241928700509553665</td><td>徐超民</td><td>340111199308278513</td><td>38186.5</td><td>农业银行</td><td>6228480669192349779</td><td></td><td>生成清单</td><td></td><td><button type="button" data-id="6241928700509553665" class="btn btn-primary btn-sm mt_3" name="deduct-query">查询批扣结果</button><button type="button" data-id="6536722135930373121" data-loan-no="6241928700509553665" class="btn btn-primary btn-sm mt_3" name="public-deduct">对公还款</button></td></tr><tr role="row" class="even"><td><input type="checkbox" value="6536722136219780097" name="ids" class="ckb"></td><td>2019-05-22</td><td>6242554182257083393</td><td>莫凡</td><td>34011119940629551X</td><td>18692.5</td><td>农业银行</td><td>6228480668089335677</td><td></td><td>生成清单</td><td></td><td><button type="button" data-id="6242554182257083393" class="btn btn-primary btn-sm mt_3" name="deduct-query">查询批扣结果</button><button type="button" data-id="6536722136219780097" data-loan-no="6242554182257083393" class="btn btn-primary btn-sm mt_3" name="public-deduct">对公还款</button></td></tr><tr role="row" class="odd"><td><input type="checkbox" value="6536722137620677633" name="ids" class="ckb"></td><td>2019-05-22</td><td>6245083276477727745</td><td>李雪</td><td>130282199212073320</td><td>21253.6</td><td>农业银行</td><td>6228480668918402672</td><td></td><td>生成清单</td><td></td><td><button type="button" data-id="6245083276477727745" class="btn btn-primary btn-sm mt_3" name="deduct-query">查询批扣结果</button><button type="button" data-id="6536722137620677633" data-loan-no="6245083276477727745" class="btn btn-primary btn-sm mt_3" name="public-deduct">对公还款</button></td></tr><tr role="row" class="even"><td><input type="checkbox" value="6536722138371458049" name="ids" class="ckb"></td><td>2019-05-22</td><td>6245891291762131969</td><td>汪立刚</td><td>420112197201043316</td><td>48031.6</td><td>农业银行</td><td>6228450058152705673</td><td></td><td>生成清单</td><td></td><td><button type="button" data-id="6245891291762131969" class="btn btn-primary btn-sm mt_3" name="deduct-query">查询批扣结果</button><button type="button" data-id="6536722138371458049" data-loan-no="6245891291762131969" class="btn btn-primary btn-sm mt_3" name="public-deduct">对公还款</button></td></tr></tbody></table><div class="bottom"><div class="dataTables_info" id="lendingList_info" role="status" aria-live="polite">显示第 1 - 10 条记录，共1,123 条</div><div class="dataTables_length" id="lendingList_length"><label> <select name="lendingList_length" aria-controls="lendingList" class="form-control input-sm"><option value="10">10</option><option value="25">25</option><option value="50">50</option><option value="100">100</option></select> </label></div><div class="dataTables_paginate paging_full_numbers" id="lendingList_paginate"><ul class="pagination"><li class="paginate_button first disabled" id="lendingList_first"><a href="javascript:void(0);" aria-controls="lendingList" data-dt-idx="0" tabindex="0">首页</a></li><li class="paginate_button previous disabled" id="lendingList_previous"><a href="javascript:void(0);" aria-controls="lendingList" data-dt-idx="1" tabindex="0">上页</a></li><li class="paginate_button active"><a href="javascript:void(0);" aria-controls="lendingList" data-dt-idx="2" tabindex="0">1</a></li><li class="paginate_button "><a href="javascript:void(0);" aria-controls="lendingList" data-dt-idx="3" tabindex="0">2</a></li><li class="paginate_button "><a href="javascript:void(0);" aria-controls="lendingList" data-dt-idx="4" tabindex="0">3</a></li><li class="paginate_button "><a href="javascript:void(0);" aria-controls="lendingList" data-dt-idx="5" tabindex="0">4</a></li><li class="paginate_button "><a href="javascript:void(0);" aria-controls="lendingList" data-dt-idx="6" tabindex="0">5</a></li><li class="paginate_button disabled" id="lendingList_ellipsis"><a href="javascript:void(0);" aria-controls="lendingList" data-dt-idx="7" tabindex="0">…</a></li><li class="paginate_button "><a href="javascript:void(0);" aria-controls="lendingList" data-dt-idx="8" tabindex="0">113</a></li><li class="paginate_button next" id="lendingList_next"><a href="javascript:void(0);" aria-controls="lendingList" data-dt-idx="9" tabindex="0">下页</a></li><li class="paginate_button last" id="lendingList_last"><a href="javascript:void(0);" aria-controls="lendingList" data-dt-idx="10" tabindex="0">末页</a></li></ul></div><div class="clear"></div></div></div>-->
        </div>
        <!--正文内容end-->
    </div>
    <form id="hiddenForm" name="hiddenForm" action="" method="post">
        <input type="hidden" id="startDate" name="startDate" value="">
        <input type="hidden" id="channel" name="channel" value="">
        <input type="hidden" id="delFlag" name="deductStatus" value="">
        <input type="hidden" id="payStatus" name="payStatus" value="">

    </form>

</div>
</body>
<script src="js/jquery-2.1.1.min.js"></script>
<script src="js/common.js"></script>
<script src="js/layer.js"></script>
<script>
    <!--下拉框功能-->
    $(function(){
        $.ajax({
            type: 'POST',
            url: 'http://localhost:8010/pikou/isApprovalSpinner',
            dataType: 'JSON',
            contentType: "application/json;charset=utf-8",
            success: function (res) {
                _list = res.data;
                $.each(_list,function(index,ele){

                    var optionTd = $("<option></option>").attr("value",ele.value).append(ele.label)

                    $("#deductStatus").append(optionTd)
                })
            }
        })
    })

    $(function(){
        $.ajax({
            type: 'POST',
            url: 'http://localhost:8010/pikou/isApprovalSpinner',
            dataType: 'JSON',
            contentType: "application/json;charset=utf-8",
            success: function (res) {
                _list = res.data;
                console.log(_list)
                $.each(_list,function(index,ele){

                    var optionTd = $("<option></option>").attr("value",ele.value).append(ele.label)

                    $("#deductStatus").append(optionTd)
                })
            }
        })

        $.ajax({
            type: 'POST',
            url: 'http://localhost:8010/pikou/statusSpinner',
            dataType: 'JSON',
            contentType: "application/json;charset=utf-8",
            success: function (res) {
                _list = res.data;
                console.log(_list)
                $.each(_list,function(index,ele){

                    var optionTd = $("<option></option>").attr("value",ele.StatusValue).append(ele.statusName)

                    $("#paySts").append(optionTd)
                })
            }
        })



    })

    function _search(_page) {
        var loanContractNum,customerName,idCode,paymentAccount,pageIndex,pageSize;
        loanContractNum = $("#loanContNo").val();
        customerName = $("#custName").val();
        idCode = $("#idNo").val();
        paymentAccount = $("#acctNo").val();
        pageSize=$("")
        //createTime=$("#applyDateStart2")

        if(_page!=""){
            var tmp={
                "loanContractNum":loanContractNum,
                "customerName":customerName,
                "idCode":idCode,
                "paymentAccount":paymentAccount,
                "pageIndex":_page,
               // "createTime":createTime,
                "pageSize":1

            };
        }else{
            var tmp={
                "loanContractNum":loanContractNum,
                "customerName":customerName,
                "idCode":idCode,
                "paymentAccount":paymentAccount,
                "createTime":createTime,
                "pageIndex":0,
                "pageSize":1
            };
        }


        $.ajax({
            type: 'POST',
            url: 'http://localhost:8010/pikou/queryByPage',
            dataType: 'JSON',
            data: JSON.stringify(tmp),
            contentType: "application/json;charset=utf-8",
            success: function (res) {
                _list = res.data.dataList;
                var _html = "";
                if(res.success){
                    $("#bizList_info").html("当前是第"+res.data.pageIndex+"页，共"+res.data.totalPage+"页")
                    if(_list.length>0){
                        page(2,1);
                    }
                    for(var i = 0;i<_list.length;i++){
                        _html+="<tr>"+
                            "<td>"+_list[i].id+"</td>"+
                            "<td>"+_list[i].createTime+"</td>"+
                            "<td>"+_list[i].loanContractNum+"</td>"+
                            "<td>"+_list[i].customerName+"</td>"+
                            "<td>"+_list[i].idCode+"</td>"+
                            "<td>"+_list[i].deductible+"</td>"+
                            "<td>"+_list[i].reimbursementAccountOpeningBank+"</td>"+
                            "<td>"+_list[i].paymentAccount+"</td>"+
                            "<td>"+_list[i].updateTime+"</td>"+
                            "<td>"+_list[i].createName+"</td>"+
                            "<td>"+_list[i].statusName+"</td>"

                        _html+="<tr/>";
                    }
                    $("#lendingList tbody").html(_html);

                }else{
                    console.log(res.errorMessage);
                }
            }
        })
    }
    _search()

    //分页点击事件
    $(".common_page").on("click","a",function(){
        console.log($(this));
        $(this).addClass("active");
        $(this).siblings().removeClass("active");
        var _index = parseInt($(this).attr("page"));
        if(_index==1){
            $(".prev_page").attr("disabled","disabled");
        }else{
            $(".prev_page").attr("page",_index-1);
            $(".last_page").attr("page",_index+1);
        }
        var _page = $(this).attr("page");
        _search(_page)
    })

    //分页点击事件
    $(".btn-search").on("click","a",function(){
        console.log($(this));
        $(this).addClass("active");
        $(this).siblings().removeClass("active");
        var _index = parseInt($(this).attr("page"));
        if(_index==1){
            $(".prev_page").attr("disabled","disabled");
        }else{
            $(".prev_page").attr("page",_index-1);
            $(".last_page").attr("page",_index+1);
        }
        var _page = $(this).attr("page");
        _search(_page)
    })

    //模糊查询点击事件
    $(".btn-search").on("click",function(){
        _search();

    })


    function exportBatchDeduct(){
        layer.confirm("确定要导出批扣报表吗？", {
            btn: ['确认','取消'], //按钮
            yes:function (index, layero) {
                var startTime = $("#applyDateStart").val();
                var endTime = $("#applyDateStart1").val();
                var url="http://localhost:8010/pikou/exprotExcel?id=1";//?startTime="+startTime+"&endTime="+endTime
                window.open(url);
                layer.close(index);
            },
            cancel:function(index){
                //按钮【按钮二】的回调
                layer.close(index);
            },
        });
    }




</script>
</html>